#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "capture.h"
#include <QLabel>
#include "yolov3.h"
#include "graph.h"
#include "setdialog.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
private: capture *cap;
         yolov3 *yolov3Net;
         graph *graphWindow;
         SetDialog *setting;
         QString cfgString;
         QString weightString;
         QString nameString;
         double confidence;
         cv::Mat preimg;
public:
    MainWindow(QWidget *parent = nullptr);
//    void transformMatToImage(cv::Mat&,QImage&);
    void labelDisplayMat(QLabel *label, cv::Mat &mat);
    void connectEvents();
    void switchStatus();
    double ImageSimilarity(const cv::Mat&,const cv::Mat&);
    ~MainWindow();

public slots:
    void detect();
    void showViolationLists(cv::Mat);
    void showPic(QListWidgetItem*);
    void changeCfg(QString);
    void changeName(QString);
    void changeWeight(QString);
    void changeConfidence(double);
    void modifyNet();

private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
